<?php
namespace app\index\controller;

use think\Controller;
use think\Db;
class Index extends Controller
{
    public function index(){

        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
        $names=Db::table('tf_collaborate')->select();
        $this->assign('names', $names);
        $table=Db::table('tf_film')->alias('a')->join('tf_film_mod b','a.mid=b.id')->select();//电影
        $this->assign('table', $table);
        $titles = Db::table('tf_information')->select();
        $this->assign('titles', $titles);
        $aa=Db::table('tf_teleplay')->alias('a')->join('tf_teleplay_mod b','a.mid=b.id')->select();//电视剧
        $this->assign('aa', $aa);

        return view('index/index');
    }
    public function guanyuyouzhan(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
        return view('guanyuyouzhan/guanyuyouzhan');
    }
    public function Dianying(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
            $names=Db::table('tf_film')->alias('a')->join('tf_film_mod b','a.mid=b.id')->paginate('', false, page_param());
            $this->assign('names', $names);

        return view('dianying/dianying');
    }
    public function dianshiju(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
        $names=Db::table('tf_teleplay')->alias('a')->join('tf_teleplay_mod b','a.mid=b.id')->select();
        $this->assign('names', $names);
        return view('dianshiju/dianshiju');
    }
    public function hezuohuoban(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
        $names=Db::table('tf_collaborate')->select();
        $this->assign('names', $names);

        return view('hezuohuoban/hezuohuoban');
    }
    public function jingdiananli(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
        $names = Db::table('tf_film','tf_teleplay')->where('zxm',1)->select();
        //$names = Db::table('tf_teleplay')->select();
        $this->assign('names', $names);
        $title = Db::table('tf_teleplay')->where('zxm',1)->select();
        //$names = Db::table('tf_teleplay')->select();
        $this->assign('title', $title);
//                    print_r($names);
//                    die();
        return view('jingdiananli/jingdiananli');
    }
    public function xinwenzixun(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
        $names = Db::table('tf_information')->select();
        $this->assign('names', $names);
        return view('xinwenzixun/xinwenzixun');
    }
    public function nan(){
        $name = Db::table('tf_headline')->select();
        $this->assign('name', $name);
                $id=$_GET['id'];
                $names = Db::table('tf_information')->select($id);
                $this->assign('names', $names);
        return view('i/i');
    }
}